home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / utmisc2 / fiflb382.lha / defs.h < prev    next >
C/C++ Source or Header  |  1996-05-13  |  2KB  |  92 lines

  1.  
  2. /*
  3.  *  DEFS.H
  4.  *
  5.  */
  6.  
  7. /*  useful with GCC macro-based inlines */
  8. #define __CONSTLIBBASEDECL__ const
  9.  
  10. #include <exec/types.h>
  11. #include <exec/nodes.h>
  12. #include <exec/ports.h>
  13. #include <exec/memory.h>
  14. #include <exec/libraries.h>
  15. #include <exec/execbase.h>
  16. #include <exec/semaphores.h>
  17. #include <devices/timer.h>
  18. #if defined(_DCC)
  19. #include <clib/exec_protos.h>
  20. #include <clib/alib_protos.h>
  21. #else
  22. #include <proto/exec.h>
  23. #include <proto/alib.h>
  24. #endif
  25. #include <libraries/fifo.h>
  26. /*  do NOT include prototypes or inlines in the library itself */
  27. #include <string.h>
  28. #if defined(__GNUC__) && defined(__OPTIMIZE__)
  29. #include <inline/strsup.h>
  30. #endif
  31.  
  32. #if defined(__GNUC__)
  33. #define LibCall
  34. #else
  35. #define LibCall __geta4 __stkargs
  36. #endif
  37. #define Prototype extern
  38.  
  39. typedef unsigned char ubyte;
  40. typedef unsigned short uword;
  41. typedef unsigned long ulong;
  42. typedef struct MsgPort    MsgPort;
  43. typedef struct Message    Message;
  44. typedef struct MinNode    Node;
  45. typedef struct MinList    List;
  46. typedef struct List    MaxList;
  47. typedef struct Node    MaxNode;
  48. typedef struct Library    Library;
  49. typedef struct ExecBase ExecBase;
  50. typedef struct SignalSemaphore SignalSemaphore;
  51.  
  52. #define FIFOF_CLOSEOF    0x00010000
  53. #define FIFOF_RDNORM    0x00020000
  54. #define FIFOF_WRNORM    0x00040000
  55.  
  56. typedef struct Fifo {
  57.     MaxNode fi_Node;
  58.     List    fi_HanList;
  59.     List    fi_WrNotify;
  60.     List    fi_RdNotify;
  61.     uword   fi_RRefs;
  62.     uword   fi_WRefs;
  63.     uword   fi_ORefs;
  64.     ubyte   fi_Lock;        /*  non-normal fifo's   */
  65.     ubyte   fi_Reserved;
  66.     long    fi_RIdx;
  67.     long    fi_WIdx;
  68.     long    fi_Flags;
  69.     SignalSemaphore fi_SigSem;    /*  normal fifo's       */
  70.     long    fi_BufSize;
  71.     long    fi_BufMask;
  72.     char    fi_Buf[4];
  73. } Fifo;
  74.  
  75. typedef struct FHan {
  76.     Node    fh_Node;
  77.     Fifo    *fh_Fifo;
  78.     long    fh_Flags;
  79.     MsgPort fh_Port;
  80.     Message fh_Msg;
  81.     long    fh_RIdx;
  82. } FHan;
  83.  
  84. extern const char LibName[];
  85. extern const char LibId[];
  86. extern List FifoList;
  87. extern ExecBase * SysBase;
  88.  
  89. /* Were Protoize used
  90. #include "fifolib-protos.h"
  91. */
  92.